﻿
@{
    ViewBag.Title = "DataTable";
    // Layout = null;   //如果用IFrame  注释这行
}

@RenderPage("~/Areas/EasyUI/Views/Shared/_EasyUI.cshtml")     @*如果用IFrame  引用这行*@ 
 
<style type="text/css">
    .textbox.combo
    {
        margin-right: 20px;
    }
</style>

<table id="datagrids" class="easyui-datagrid" title="数据" data-options="singleSelect:true,selectOnCheck:false,checkOnSelect:true,pageSize:5,pageList: [5, 10, 15, 20],iconCls: 'icon-edit',rownumbers:true,pagination:true,url:'/EasyUI/DataGrid/GetProductList',method:'get',toolbar:'#tools',onDblClickCell: onDblClickCell,onAfterEdit:onAfterEdit">
    <thead>
        <tr>
            <th data-options="field:'ProductId',checkbox:true" style="width:2%"></th>
            <th data-options="field:'ProductName',editor:'text'" style="width:20%">名称</th>
            <th data-options="field:'UnitCost',editor:'numberbox'" style="width:10%">单位</th>
            <th data-options="field:'Status',editor:{type:'checkbox',options:{on:'上架',off:'下架'}}" formatter="formatstatus" style="width:10%">状态</th>
            <th data-options="field:'Prices',editor:{type:'numberspinner',options:{min:0,precision:2}}" style="width:10%">价格</th>
            <th data-options="field:'Types',editor:{type:'combobox',options:{data:clothtypejson,valueField:'value',textField:'text',panelHeight:'auto'}}" style="width:5%" formatter="formattypes">类型</th>
            <th data-options="field:'Details',editor:'text'" style="width:35%">详情</th>
        </tr>
    </thead>
</table>

<div id="tools" style="padding:5px;height:auto">
    <div>
        <label style="padding: 0 10px 0 10px;">开始时间</label><input id="startdate" class="easyui-datebox" name="startdate" data-options="prompt:'请选择开始日期'">
        <label style="padding: 0 10px 0 10px;">结束时间 </label><input id="enddate" class="easyui-datebox" name="enddate" data-options="prompt:'请选择结束日期',disabled:true">
        <label style="padding: 0 10px 0 10px;">类型:</label><select class="easyui-combobox" id="clothtype" panelHeight="auto" style="width:100px">
            <option value="">全部</option>
            <option value="1">西装</option>
            <option value="2">衬衫</option>
            <option value="3">裤子</option>
        </select>
        <a href="#" class="easyui-linkbutton" id="searchs" iconCls="icon-search" style="width:80px" on>搜索</a>
    </div>
    <div style="margin-bottom:5px">
        <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="$('#addproductdiglog').dialog('open')"></a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true"></a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="SaveEdit()" plain="true"></a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-undo" onclick="RejectEdit()" plain="true"></a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-cut" plain="true"></a>
        <a href="#" class="easyui-linkbutton" id="data-remove" iconCls="icon-remove" plain="true"></a>
        <a href="#" class="easyui-linkbutton" id="data-export" iconCls="icon-set" plain="true">导出</a>
        <a href="#" class="easyui-linkbutton" id="data-import" iconCls="icon-set" plain="true">导入</a> 
        <form id="filesubmit" action="FileImport" method="post"> 
            @Html.AntiForgeryToken()
            <input type="file" id="fileimport" style="display:none" name="file" /> 
        </form>
    </div>
</div>

<div id="addproductdiglog" closed="true" class="easyui-dialog" title="添加商品" style="padding:20px">
    <form id="addproduct_form" class="easyui-form" method="post" data-options="novalidate:true">
        @Html.AntiForgeryToken()
        <table>
            <tr>
                <td>名称:</td>
                <td><input class="easyui-textbox" type="text" name="ProductName" data-options="required:true"></td>
            </tr>
            <tr>
                <td>单位:</td>
                <td><input class="easyui-numberbox" type="text" name="UnitCost" data-options="required:true"></td>
            </tr>
            <tr>
                <td>状态:</td>
                <td>
                    <input type="radio" name="Status" value="1" />上架
                    <input type="radio" name="Status" value="2" />下架
                </td>
            </tr>
            <tr>
                <td>价格:</td>
                <td><input class="easyui-textbox" name="Prices"></td>
            </tr>
            <tr>
                <td>类型:</td>
                <td><select class="easyui-combobox" id="SelectTypes" data-options="panelHeight:'auto',width:'100'" name="Types"><option value="0">请选择</option><option value="1">西装</option><option value="2">衬衫</option><option value="3">裤子</option></select></td>
            </tr>
            <tr>
                <td>详情:</td>
                <td><input class="easyui-textbox" name="Details" data-options="multiline:true" style="height:60px"></td>
            </tr>
        </table>
    </form>
    <div style="text-align:center;padding:5px">
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="SubmitProduct()">提交</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#addproduct_form').form('clear');">清除</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#addproductdiglog').dialog('close')">取消</a>
    </div>
</div> 
 
<script src="/Areas/EasyUI/Scripts/Admin/DataGrid.js"></script> 
